<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>动画效果切换显示隐藏</title>
		<script src="../libs/vue.js" type="text/javascript"></script>
		<style>
			<!--此css名配合transition标签使用-->
			.v-enter,
			.v-leave-to {
				opacity: 0;
			}
			.v-enter-active,
			.v-leave-active{
				transition: opacity 1s;
				font-size: 24px;
			}
			
			<!-- .fade-enter{
				opacity: 0;
			}
			.fade-enter-active {
				transition: opacity 2s;
			} -->
			
		</style>
	</head>
	<body>
		
		<div id="root">
			<transition>  <!-- name="fade" -->
				<div v-if="show">hello world</div>
			</transition>
			<button @click="handleClick">切换</button>
			
			
		</div>
		<script>
			var vm = new Vue({
				el:'#root',
				data:{
					show:false
				},
				methods:{
					handleClick:function(){
						this.show = !this.show;
					}
				}
				
			});
		</script>
		
	</body>
</html>
